home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / lisp / ilisp / ilisp-kil.el.z / ilisp-kil.el
Encoding:
Text File  |  1998-05-21  |  2.5 KB  |  94 lines

  1. ;;; -*- Mode: Emacs-Lisp -*-
  2.  
  3. ;;; ilisp-kil.el --
  4.  
  5. ;;; This file is part of ILISP.
  6. ;;; Version: 5.8
  7. ;;;
  8. ;;; Copyright (C) 1990, 1991, 1992, 1993 Chris McConnell
  9. ;;;               1993, 1994 Ivan Vasquez
  10. ;;;               1994, 1995, 1996 Marco Antoniotti and Rick Busdiecker
  11. ;;;               1996 Marco Antoniotti and Rick Campbell
  12. ;;;
  13. ;;; Other authors' names for which this Copyright notice also holds
  14. ;;; may appear later in this file.
  15. ;;;
  16. ;;; Send mail to 'ilisp-request@naggum.no' to be included in the
  17. ;;; ILISP mailing list. 'ilisp@naggum.no' is the general ILISP
  18. ;;; mailing list were bugs and improvements are discussed.
  19. ;;;
  20. ;;; ILISP is freely redistributable under the terms found in the file
  21. ;;; COPYING.
  22.  
  23.  
  24.  
  25. ;;;
  26. ;;; ILISP Panic/Reset/Status commands
  27. ;;;
  28.  
  29. ;;;%% Panic/Reset/Status commands 
  30. ;;;
  31. (defun status-lisp (showp)
  32.   "Show the message of the current command being executed in the
  33. inferior LISP.  With a prefix show pending sends as well."  
  34.   (interactive "P")
  35.   (save-excursion
  36.     (set-buffer (ilisp-buffer))
  37.     (comint-current-send showp)))
  38.  
  39.  
  40. ;;;
  41. (defun reset-ilisp ()
  42.   "Reset the inferior LISP top level."
  43.   (interactive)
  44.   (message "Reset LISP to top level")
  45.   (comint-simple-send (ilisp-process) (ilisp-value 'ilisp-reset)))
  46.  
  47. ;;;
  48. (defun abort-commands-lisp (&optional message)
  49.   "Abort the commands sent to the current ilisp."
  50.   (interactive)
  51.   (if (ilisp-value comint-aborting t)
  52.       (message "Already aborted commands")
  53.       (beep)
  54.       (message (or message "Aborted commands"))
  55.       (comint-abort-sends (ilisp-process))))
  56.  
  57. ;;;
  58. (defun panic-lisp ()
  59.   "Panic reset for the inferior LISP."
  60.   (interactive)
  61.   (save-excursion
  62.     (if (y-or-n-p "Panic reset LISP? ")
  63.     (save-excursion
  64.       (set-buffer (ilisp-buffer))
  65.       (comint-setup-ipc t)
  66.       (message "LISP is reset, state is unknown"))
  67.     (message ""))))
  68.  
  69. ;;;
  70. (defun repair-ilisp ()
  71.   "If ilisp is not listening to you in the lisp interaction buffer, you might try this."
  72.   (interactive)
  73.   (set-buffer (ilisp-buffer))
  74.   (comint-setup-ipc t)
  75.   (goto-char (point-max))
  76.   (insert "()")
  77.   (return-ilisp)
  78.   (message "ILISP is working again (maybe)"))
  79.  
  80.  
  81. ;;;
  82. (defun interrupt-subjob-ilisp ()
  83.   "Interrupt the current top level command in the inferior LISP."
  84.   (interactive)
  85.   (if (not (eq comint-send-queue comint-end-queue))
  86.       (if (y-or-n-p "Abort commands before interrupting top level? ")
  87.       (abort-commands-lisp)
  88.       (message "Waiting for commands to finish")
  89.       (while (not (eq comint-send-queue comint-end-queue))
  90.         (accept-process-output)
  91.         (sit-for 0))))
  92.   (message "Interrupted top level")
  93.   (comint-interrupt-subjob))
  94.